<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<include file="Public/title" title="{$seotitle}" />
</head>

<body>
<div class="mainWrap">

	<!--标题-->
    <div class="mainWrapHeader">
    	<h1 class="mainWrapTit">{$seotitle}</h1>        
        <!--切换需要，写对应ID，及class-->
    </div>
    <!--标题-->

    <div class="mainWrapBd">
    	<table cellpadding="0" border="0" cellspacing="0" class="stdedit">

            <tr>
                <th>姓名</th>
                <td>{$info['name']}</td>

                <th>登录手机</th>
                <td>{$info['mobile']}</td>

                <th>技能</th>
                <td>上画/下画</td>

            </tr>

            <tr>               
                <th>身份证号码</th>
                <td>{$info['certid']}</td>

                <th>服务区域</th>
                <td>{$info['service_area']}</td>

                <th>邀请人</th>
                <td>{$info['partner_name']}</td>

            </tr>

            <tr>
                <th>状态</th>
                <td>
                	<if condition="$info['status'] eq 1">
                		<span style="color: #04c">待审核</span>
                		<a href="javascript:;" class="submit worker_audit" style="color:#fff">审核通过</a>
                	</if>
                    <if condition="$info['status'] eq 2">
                    	<span style="color: red">审核不通过</span>
                    	<a href="javascript:;" class="submit worker_audit" style="color:#fff">审核通过</a>
                    </if>
                    <if condition="$info['status'] eq 3"><span style="color: green">审核通过</span></if>
                </td>

            </tr>
            
        </table>

    </div>	


	
    <!--标题-->
    <div class="mainWrapHeader">
        <ul class="tab-nav clearfix">
            <li class="cur"><a href="#tab-info">任务情况</a></li>
            <li><a href="#tab-status">钱包情况</a></li>
            <li><a href="#tab-ads">提现情况</a></li>
        </ul>
        <!--切换需要，写对应ID，及class-->
    </div>
    <!--标题-->
    
    <div class="mainWrapBd">
    	<div class="tab-con" id="tab-info">
        	
            <!--列表-->
	        <table cellpadding="0" cellspacing="0" border="0" class="stdtable stdtablelist">
	            <colgroup>
	                <col />
	                <col />
	                <col />
	                <col />
	                <col />
	            </colgroup>

	            <thead>
	                <tr>
	                    <th class="center">订单号</th>
	                    <th>公司名称</th>
	                    <th>审核员</th>
	                    <th>活动名称</th>
	                    <th>门店</th>
	                    <th>店长</th>
	                    <th>状态</th>
	                    <th>城市合伙人</th>
	                    <th>更新时间</th>
	     
	                </tr>
	            </thead>
	           
	            <tbody>
	                <volist name="pages['lists']" id="fo">

            		<?php
            			$store_info = M('store')->where(['id'=>$fo['store_id']])->find();
            			var_dump($store_info);
            			$audit_info = M('audit')->where(['id'=>$store_info['auidt_id']])->find();

            			var_dump($audit_info);
            		?>
	                <tr>
	                    <td align="center">{$fo['id']}</td>
	                    <td>{$fo['name']}</td>
	                    <td>{$fo['mobile']}</td>                    
	                    <td>                        
	                        <img src="{$fo['headimg']}" style="width:80px;height:80px;"/>
	                    </td>
	                    <td>{$fo['skill']}</td> 
	                    <td>{$fo['certid']}</td>   
	                    <td>{$fo['service_area']}</td>
	                    <td>张三三</td>                
	                    <td>{$fo['status']}</td>
	                    <td>{$fo['add_time']|date="Y/m/d H:i",###}</td>
	                    <td>
	                        <a href="{:U('detail',array('id'=>$fo['id']))}">查看详情</a> &nbsp; 
	                        <!-- <a href="{:U('delete',array('id'=>$fo['id']))}" onclick="return confirm('确认删除吗？')">删除</a> &nbsp; -->
	                    </td>                  
	                    
	                </tr>
	                </volist>
	                <if condition="$pages['total'] eq 0">
	                <tr>
	                    <td align="center" class="data-nothing" colspan="11">暂无相关信息</td>
	                </tr>
	                </if>
	            </tbody>
	        </table>
	        <!--列表-->
            
        </div>
        <div class="tab-con" id="tab-status" style="display:none;">

        	<!--列表-->
	        <table cellpadding="0" cellspacing="0" border="0" class="stdtable stdtablelist">
	           
                <tr>
                    <td align="center" class="data-nothing" colspan="8">暂无相关信息</td>
                </tr>
	        </table>
	        <!--列表-->
        	
        </div>

        <div class="tab-con" id="tab-ads" style="display:none;">
        	<!--列表-->
	        <table cellpadding="0" cellspacing="0" border="0" class="stdtable stdtablelist">
	           
                <tr>
                    <td align="center" class="data-nothing" colspan="8">暂无相关信息</td>
                </tr>
	        </table>
	        <!--列表-->
        </div>
    </div>
    
</div>
</body>
</html>

<script type="text/javascript">
	//分配订单
	$(".worker_audit").click(function(event) {

		var audit_con = '<div id="audit_con"><table cellpadding="0" cellspacing="0" border="0" class="stdtable stdtablelist"><tr><td>师傅审核</td><td><select name="status" id="audit_status"><option value="1">请选择审核结果</option><option value="3">审核通过</option><option value="2">审核不通过</option></select></td></tr><tr><td>审核说明</td><td><input type="text" id="audit_info" class="sys_text"/><span style="color:red">*审核失败必填</span></td></tr><tr><td colspan="2"><input type="button" class="submit" id="audit_commit" value="确认审核"/></td></tr></table></div>';

		//页面层
		layer.open({
			type: 1,
			title: "师傅审核",
			skin: 'layui-layer-rim', //加上边框
			area: ['450px', '400px'], //宽高
			content: audit_con
		});
	});

	//确认审核
	$("#audit_commit").live("click",function(){

		var id = {$info['id']};
		var audit_status = $("#audit_status").val();
		var audit_info = $("#audit_info").val();

		if(audit_status == 1){
			alert('请选择审核意见');
			return false;
		}

		if(audit_info == ''){
			alert('请输入审核意见');
			return false;
		}
	  	
		$.post('{:U("audit_commit")}',{"id":id,"status":audit_status,"audit_info":audit_info},function(d){

			alert(d.msg);

		},"json");

	});

	
</script>